The present invention relates to different databases and more particularly to a method and system for automatically synchronizing different classes of databases.
There are different classes of conventional databases. One class of databases is relational databases, such as DB/2 databases. Relational databases are made up of tables containing columns and rows. One table in a relational database can be related to another table using a pointer. The pointer at one entry in the first table relates the two tables by pointing to an entry in the second table. Relational databases are useful in part because they are capable of efficiently storing large amounts of information without requiring redundancies. Conventional relational databases may also serve as repository databases, which contain metadata describing a particular database. In the context of this application, metadata is information describing the structure of a database.
A second class of databases is document oriented databases, for example LOTUS NOTES databases. Document oriented databases consist of collections of documents which may or may not be related. Each document in the database can contain several fields. Document oriented databases are useful for storing freeform data and may serve as repositories which contain metadata describing the structure of a particular database.
It is sometimes useful to store the same information in two classes of databases. The two databases are known as a front end database and a back end database. The front end database may be a document oriented database, such as a LOTUS NOTES database. The back end database may be a relational database, such as DB/2. Using these conventional databases a user can take information in a nonrelational database that is of interest and efficiently store the information in a relational database.
Because two different classes of databases are being used to store the same information, it is desirable to synchronize the front end and back end databases. Synchronization of two databases is achieved through a map between the databases. The map allows a user to input data into one database and generates the information in the corresponding location in the second database. Thus, when databases are synchronized, a user can edit the data stored in one database and have the edits also appear in the second database.
A conventional method for synchronizing a front end database and a back end database requires a user to manually perform several steps of the synchronization. For example, one conventional mechanism for synchronizing databases is a product known as NOTES PUMP. NOTES PUMP allows a user to synchronize a LOTUS NOTES database and a DB/2 database by setting a one-to-one correspondence between the forms and fields in a predefined front end database and the tables and columns in a predefined back end database. NOTES PUMP can then move data between the front end database into the back end relational database.
Although NOTES PUMP is capable of synchronizing the data in preexisting databases, NOTES PUMP requires the user to perform several operations. A portion of each phase of synchronizing the front end and back end databases is carried out manually. If there are several structures that must be mapped, the user must specify the one-to-one correspondence for each structure manually. If the user later makes changes in the structure of one database, the user must also indicate the changes in the mechanism for synchronizing the databases and in the other database. Consequently, conventional methods and mechanisms for synchronizing two classes of databases are relatively time consuming and prone to error.
Accordingly, what is needed is a system and method for synchronizing different classes of databases without requiring significant user input. The present invention addresses such a need.
The present invention provides a method and system for synchronizing a first database and a second database. The first database is of a first class, while the second database is of a second class. In one aspect, the method and system comprise providing a repository database for storing metadata regarding the first database and the second database, automatically generating the first database using a first portion of the metadata, and automatically generating the second database using a second portion of the metadata. The method and system further comprise automatically generating a mapping between the first database and the second database using a third portion of the metadata stored in the repository database. In a second aspect, the first database is a preexisting database. In this aspect, the method and system include providing a repository database for storing metadata regarding the first database and the second database and automatically generating the second database using a first portion of the metadata. In this aspect, the method and system further comprise automatically generating a mapping between the first database and the second database using a second portion of the metadata stored in the repository database.
According to the system and method disclosed herein, the present invention allows a user to easily store and manipulate information in two databases of different classes, thereby decreasing development time and maintenance effort.